package org.jeecg.modules.supplier.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Column;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;


@Data
@TableName(value="proc_supplier")
@ApiModel(value = "Supplier对象", description = "供应商信息")
@Table(name = "proc_supplier")
public class Supplier implements Serializable {
    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "主键")
    private String id;

    @ApiModelProperty(value = "公司名称")
    @NotBlank(message = "公司名称不能为空")
    @Column(name = "company_name")
    @Excel(name = "公司名称")
    private String companyName;

    @ApiModelProperty(value = "统一社会信用代码")
    @NotBlank(message = "统一社会信用代码不能为空")
    @Column(name = "credit_code")
    @Excel(name = "统一社会信用代码")
    private String creditCode;

    @ApiModelProperty(value = "成立日期")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @Column(name = "establish_date")
    @Excel(name = "成立日期")
    private Date establishDate;

    @ApiModelProperty(value = "注册资本")
    @Column(name = "registered_capital")
    @Excel(name = "注册资本")
    private BigDecimal registeredCapital;

    @ApiModelProperty(value = "公司地址")
    @Column(name = "company_address")
    @Excel(name = "公司地址")
    private String companyAddress;

    @ApiModelProperty(value = "经营范围")
    @Column(name = "business_scope")
    @Excel(name = "经营范围")
    private String businessScope;

    @ApiModelProperty(value = "工程类目")
    @Column(name = "engineering_categories")
    @Excel(name = "工程类目")
    private String engineeringCategories;

    @ApiModelProperty(value = "联系人姓名")
    @Column(name = "contact_name")
    @Excel(name = "联系人姓名")
    private String contactName;

    @ApiModelProperty(value = "联系人手机")
    @Column(name = "contact_phone")
    @Excel(name = "联系人手机")
    private String contactPhone;

    @ApiModelProperty(value = "资质名称")
    @NotBlank(message = "资质名称不能为空")
    @Column(name = "qualification_name")
    @Excel(name = "资质名称")
    private String qualificationName;

    @ApiModelProperty(value = "资质等级")
    @Column(name = "qualification_level")
//    @Excel(name = "资质等级")
    private String qualificationLevel;

    @ApiModelProperty(value = "联系人邮箱")
    @Column(name = "contact_email")
    @Excel(name = "联系人邮箱")
    private String contactEmail;

    @ApiModelProperty(value = "联系人角色：1-法人，2-财务联系人，3-业务联系人")
    @Dict(dicCode = "contact_role")
    @Column(name = "contact_role")
    @Excel(name = "联系人角色")
    private String contactRole;

    @ApiModelProperty(value = "开户行")
    @Column(name = "bank_name")
    @Excel(name = "开户行")
    private String bankName;

    @ApiModelProperty(value = "开户名")
    @Column(name = "account_name")
    @Excel(name = "开户名")
    private String accountName;

    @ApiModelProperty(value = "账号")
    @Column(name = "account_number")
    @Excel(name = "账号")
    private String accountNumber;

    @ApiModelProperty(value = "银行账户备注")
    @Column(name = "bank_remark")
    private String bankRemark;

    @ApiModelProperty(value = "附件路径")
    @Column(name = "attachments")//改成数组
    private String attachments;
//     private List<?> attachments;

    @ApiModelProperty(value = "审核状态：0-待审核，1-审核通过，2-退回补正，3-拒绝")
    @Dict(dicCode = "audit_status")
    @Column(name = "audit_status")
    private String auditStatus;

    @ApiModelProperty(value = "审核意见")
    @Column(name = "audit_opinion")
    private String auditOpinion;

    @ApiModelProperty(value = "审核人")
    @Column(name = "auditor")
    private String auditor;

    @ApiModelProperty(value = "审核时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Column(name = "audit_time")
    private Date auditTime;

    @ApiModelProperty(value = "供应商总评分")
    @Column(name = "total_score")
    private BigDecimal totalScore;

    @ApiModelProperty(value = "最新评分时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Column(name = "latest_score_time")
    private Date latestScoreTime;


    @ApiModelProperty(value = "中签率")
    @Column(name = "winning_rate")
    private Double winningRate;

    //衰减值
    @ApiModelProperty(value = "衰减值")
    @Column(name = "reduction")
    private Double reduction;

    @ApiModelProperty(value = "评价次数")
    @Column(name = "evaluation_count")
    private Integer evaluationCount;

    @ApiModelProperty(value = "平均评分")
    @Column(name = "avg_score")
    private BigDecimal avgScore;


    @ApiModelProperty(value = "是否有未完工项目：0-否，1-是")
    @Column(name = "has_unfinished_project")
    private Integer hasUnfinishedProject;

    @ApiModelProperty(value = "创建人")
    @Column(name = "create_by")
    @Excel(name = "创建人")
    private String createBy;

    @ApiModelProperty(value = "创建日期")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT)
    @Excel(name = "创建日期")
    @Column(name = "create_time")
    private Date createTime;

    @ApiModelProperty(value = "更新人")
    @Column(name = "update_by")
    private String updateBy;

    @ApiModelProperty(value = "更新日期")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @Column(name = "update_time")
    private Date updateTime;



}
